﻿#ifndef BOOK_SQL_H
#define BOOK_SQL_H
//头文件，cpp未完成，别动了

#include <QMessageBox>
#include <QCoreApplication>
#include <QSqlQuery>
#include <QtDebug>
#include <QSqlError>
#include <QDir>
struct book_info
{
    QString book;
    QString borrow_left;
    QString borrow_allow;
    QString author;
    QString page;
    QString borrow_ID;
    QString store_place;
    QString borrow_date;
    QString borrow_num;



    book_info(QString BOOK,QString BORROW_left,QString allow,QString AUthority,QString PAGE, QString ID, QString store,  QString DATE
              ,QString NUM)//这是一个初始化
    {
        book=BOOK;
        borrow_left=BORROW_left;
        borrow_allow=allow;
        author=AUthority;
        page=PAGE;
        borrow_ID=ID;
        store_place=store;
        borrow_date=DATE;
        borrow_num=NUM;//int类型的书
    }

};

class book_sql :public QObject
{
    Q_OBJECT
public:
    explicit book_sql(QObject *parent = nullptr);
    void bok_init();//初始化
    QSqlDatabase book_db;
    bool add_book(book_info bok);
    QList<book_sql> GetAll();//显示全部图书信息
};

#endif
